<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - json.h File Reference</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="https://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="https://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="https://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">json.h File Reference</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Fri Oct 16 2020 by Robert van Engelen</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6f9635d4fbfa321d4c00f29df5cd540c.html">samples</a></li><li class="navelem"><a class="el" href="dir_cb805d470c20465bb8777f0f0cdd41a1.html">xml-rpc-json</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">json.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;soapH.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for json.h:</div>
<div class="dyncontent">
<div class="center"><img src="json_8h__incl.png" border="0" usemap="#json_8h" alt=""/></div>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a066bbc2f0263928a94b30d65320f9945"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a066bbc2f0263928a94b30d65320f9945">json_error</a> (struct soap *soap, struct <a class="el" href="structvalue.html">value</a> *v)</td></tr>
<tr class="memdesc:a066bbc2f0263928a94b30d65320f9945"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set value to JSON error property given the context's error code, as per Google JSON Style Guide.  <a href="#a066bbc2f0263928a94b30d65320f9945">More...</a><br /></td></tr>
<tr class="separator:a066bbc2f0263928a94b30d65320f9945"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6aa4b933cac792280e0a7844d346cf01"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a6aa4b933cac792280e0a7844d346cf01">json_send_fault</a> (struct soap *soap)</td></tr>
<tr class="memdesc:a6aa4b933cac792280e0a7844d346cf01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Respond with a JSON error when an internal fault occurred (i.e. soap-&gt;error is nonzero), as per Google JSON Style Guide.  <a href="#a6aa4b933cac792280e0a7844d346cf01">More...</a><br /></td></tr>
<tr class="separator:a6aa4b933cac792280e0a7844d346cf01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e7cde2a9cf69f2ba6a16049c95225a0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a7e7cde2a9cf69f2ba6a16049c95225a0">json_send_error</a> (struct soap *soap, int status, const char *message, const char *details)</td></tr>
<tr class="memdesc:a7e7cde2a9cf69f2ba6a16049c95225a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send JSON error back to the client using the specified HTTP status code and a message and details, as per Google JSON Style Guide.  <a href="#a7e7cde2a9cf69f2ba6a16049c95225a0">More...</a><br /></td></tr>
<tr class="separator:a7e7cde2a9cf69f2ba6a16049c95225a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0b41e1415944a28b8ef92dc98be8c50"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#ae0b41e1415944a28b8ef92dc98be8c50">json_write</a> (struct soap *soap, const struct <a class="el" href="structvalue.html">value</a> *v)</td></tr>
<tr class="memdesc:ae0b41e1415944a28b8ef92dc98be8c50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write JSON value to the context's output (socket, stream, FILE, or string)  <a href="#ae0b41e1415944a28b8ef92dc98be8c50">More...</a><br /></td></tr>
<tr class="separator:ae0b41e1415944a28b8ef92dc98be8c50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c7efe04167da2598017b8734bc4a527"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a9c7efe04167da2598017b8734bc4a527">json_send</a> (struct soap *soap, const struct <a class="el" href="structvalue.html">value</a> *v)</td></tr>
<tr class="memdesc:a9c7efe04167da2598017b8734bc4a527"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send JSON value, requires soap_begin_send() before this call and soap_end_send() to finish, this function is used by <a class="el" href="json_8h.html#ae0b41e1415944a28b8ef92dc98be8c50" title="Write JSON value to the context&#39;s output (socket, stream, FILE, or string) ">json_write()</a>  <a href="#a9c7efe04167da2598017b8734bc4a527">More...</a><br /></td></tr>
<tr class="separator:a9c7efe04167da2598017b8734bc4a527"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a927016fe60cb59422e4769dd7803462c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a927016fe60cb59422e4769dd7803462c">json_read</a> (struct soap *soap, struct <a class="el" href="structvalue.html">value</a> *v)</td></tr>
<tr class="memdesc:a927016fe60cb59422e4769dd7803462c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read JSON value from context's input (socket, stream, FILE, or string)  <a href="#a927016fe60cb59422e4769dd7803462c">More...</a><br /></td></tr>
<tr class="separator:a927016fe60cb59422e4769dd7803462c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a328f12bad425de77a0df4e31471bb1c2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a328f12bad425de77a0df4e31471bb1c2">json_recv</a> (struct soap *soap, struct <a class="el" href="structvalue.html">value</a> *v)</td></tr>
<tr class="memdesc:a328f12bad425de77a0df4e31471bb1c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive JSON value, requires soap_begin_recv() before this call and soap_end_recv() to finish, this function is used by <a class="el" href="json_8h.html#a927016fe60cb59422e4769dd7803462c" title="Read JSON value from context&#39;s input (socket, stream, FILE, or string) ">json_read()</a>  <a href="#a328f12bad425de77a0df4e31471bb1c2">More...</a><br /></td></tr>
<tr class="separator:a328f12bad425de77a0df4e31471bb1c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2e35bee99cf7ceec6bc2d245ecb0112"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#af2e35bee99cf7ceec6bc2d245ecb0112">json_call</a> (struct soap *soap, const char *endpoint, const struct <a class="el" href="structvalue.html">value</a> *in, struct <a class="el" href="structvalue.html">value</a> *out)</td></tr>
<tr class="separator:af2e35bee99cf7ceec6bc2d245ecb0112"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ec9df865c21e0c3e0b9d863afe27df2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="json_8h.html#a8ec9df865c21e0c3e0b9d863afe27df2">json_send_string</a> (struct soap *soap, const char *s)</td></tr>
<tr class="memdesc:a8ec9df865c21e0c3e0b9d863afe27df2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert string to JSON string and write it to context's output.  <a href="#a8ec9df865c21e0c3e0b9d863afe27df2">More...</a><br /></td></tr>
<tr class="separator:a8ec9df865c21e0c3e0b9d863afe27df2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="af2e35bee99cf7ceec6bc2d245ecb0112"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_call </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>out</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Client-side JSON REST call to endpoint URL with optional in and out values (POST with in/out, GET with out, PUT with in, DELETE without in/out), returns SOAP_OK or HTTP status code </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL of the JSON REST/RPC service </td></tr>
    <tr><td class="paramname">in</td><td>value to send, or NULL (when non-NULL: PUT or POST, when NULL: GET or DELETE) </td></tr>
    <tr><td class="paramname">out</td><td>value to receive, or NULL (when non-NULL: GET or POST, when NULL: PUT or DELETE) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or HTTP status code or an error code with out set to the JSON error property when the error was returned by the server </dd></dl>

</div>
</div>
<a class="anchor" id="a066bbc2f0263928a94b30d65320f9945"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_error </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set value to JSON error property given the context's error code, as per Google JSON Style Guide. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context with soap-&gt;error set </td></tr>
    <tr><td class="paramname">v</td><td>value to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>error code </dd></dl>

</div>
</div>
<a class="anchor" id="a927016fe60cb59422e4769dd7803462c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_read </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read JSON value from context's input (socket, stream, FILE, or string) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">v</td><td>value to read (non NULL) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or error code </dd></dl>

</div>
</div>
<a class="anchor" id="a328f12bad425de77a0df4e31471bb1c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_recv </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive JSON value, requires soap_begin_recv() before this call and soap_end_recv() to finish, this function is used by <a class="el" href="json_8h.html#a927016fe60cb59422e4769dd7803462c" title="Read JSON value from context&#39;s input (socket, stream, FILE, or string) ">json_read()</a> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">v</td><td>value to receive (non NULL) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or error code </dd></dl>

</div>
</div>
<a class="anchor" id="a9c7efe04167da2598017b8734bc4a527"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_send </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send JSON value, requires soap_begin_send() before this call and soap_end_send() to finish, this function is used by <a class="el" href="json_8h.html#ae0b41e1415944a28b8ef92dc98be8c50" title="Write JSON value to the context&#39;s output (socket, stream, FILE, or string) ">json_write()</a> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">v</td><td>value to send </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or error code </dd></dl>

</div>
</div>
<a class="anchor" id="a7e7cde2a9cf69f2ba6a16049c95225a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_send_error </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>status</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>details</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send JSON error back to the client using the specified HTTP status code and a message and details, as per Google JSON Style Guide. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context with soap-&gt;error set </td></tr>
    <tr><td class="paramname">status</td><td>HTTP error status code or SOAP_OK (0) </td></tr>
    <tr><td class="paramname">message</td><td>error message </td></tr>
    <tr><td class="paramname">details</td><td>error detail or NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>error code </dd></dl>

</div>
</div>
<a class="anchor" id="a6aa4b933cac792280e0a7844d346cf01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_send_fault </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Respond with a JSON error when an internal fault occurred (i.e. soap-&gt;error is nonzero), as per Google JSON Style Guide. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context with soap-&gt;error set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>error code </dd></dl>

</div>
</div>
<a class="anchor" id="a8ec9df865c21e0c3e0b9d863afe27df2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_send_string </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert string to JSON string and write it to context's output. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">s</td><td>string to send </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or error code </dd></dl>

</div>
</div>
<a class="anchor" id="ae0b41e1415944a28b8ef92dc98be8c50"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int json_write </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structvalue.html">value</a> *&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write JSON value to the context's output (socket, stream, FILE, or string) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td>context that manages IO </td></tr>
    <tr><td class="paramname">v</td><td>value to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SOAP_OK or error code </dd></dl>

</div>
</div>
</div><!-- contents -->
<hr class="footer">
<address class="footer">
Copyright (C) 2020, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Fri Oct 16 2020 16:44:40 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.11</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
